package com.xmgps.bdt.infrastructure.util;

import io.netty.buffer.ByteBuf;
import org.apache.commons.codec.binary.Hex;

/**
 * 16进制转换
 * 2022/6/20
 */
public class HexUtil {

    public static String encodeString(ByteBuf src,int length){
        byte data[] = new byte[length];
        int readerIndex = src.readerIndex();
        src.readBytes(data);
        src.readerIndex(readerIndex);
        return Hex.encodeHexString(data);
    }
}
